package callback;

import view.LobbyView;

public class UpdateRoomCallback implements Callback {

	private LobbyView mLobbyView;
	private int mDelta;
	
	public UpdateRoomCallback(LobbyView lobbyView, int delta) {
		this.mLobbyView = lobbyView;
		this.mDelta = delta;
	}
	
	@Override
	public void perform() {
		if(mLobbyView.getCurrentPageIndex() + mDelta < 0)
			return;
			
		mLobbyView.setCurrentPageIndex(mLobbyView.getCurrentPageIndex() + mDelta);
		mLobbyView.showRoom();
	}

	
}
